package ran.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ran
 * Date: 2025-10-03
 * Time: 15:28
 */
@Getter
@AllArgsConstructor
public enum ResultCode {
    //操作唱功
    SUCCESS (1000, "操作成功"),
    //服务器内部错误，友好提示
    ERROR (2000, "服务繁忙请稍后重试"),
    //操作失败，但是服务器不存在异常
    FAILED (3000, "操作失败"),
    FAILED_UNAUTHORIZED (3001, "未授权"),
    FAILED_PARAMS_VALIDATE (3002, "参数校验失败"),
    FAILED_NOT_EXISTS (3003, "资源不存在"),
    FAILED_ALREADY_EXISTS (3004, "资源已存在"),
    // 用户操作
    AILED_USER_EXISTS (3101, "用户已存在"),
    FAILED_USER_NOT_EXISTS (3102, "用户不存在"),
    FAILED_LOGIN (3103, "账号或密码错误"),
    FAILED_USER_BANNED (3104, "您已被列入黑名单, 请联系管理员."),
    FAILED_USER_PHONE(3105,"输入的邮箱格式不正确"),
    FAILED_FREQUENT_CODE(3106,"验证码获取过于频繁,请一分钟后重试"),
    FAILED_CODE_LIMIT(3107,"今日验证码获取已达上限,请明日重试"),
    FAILED_MAIL_SEND(3108,"邮件验证码发送失败"),
    FAILED_EXPIRED_CODE(3109,"验证码无效或已过期"),
    FAILED_ERROR_CODE(3110,"验证码错误"),



    // 竞赛操作
    EXAM_START_TIME_BEFORE_NOW_TIME(3201,"开始时间不可以早于当前时间"),
    EXAM_START_TIME_AFTER_END_TIME(3202,"开始时间不可以晚于结束时间"),
    EXAM_NOT_EXISTS (3203, "竞赛不存在"),
    EXAM_QUESTION_NOT_EXISTS (3204, "竞赛要添加的题目不存在"),
    EXAM_STARTED(3205,"竞赛已开始,不能继续进行操作"),
    EXAM_NOT_QUESTION(3206,"竞赛中没有题目,不能继续进行操作"),
    EXAM_IS_FINISHED(3207,"竞赛已结束,不能进行操作"),
    EXAM_PUBLISHED(3208,"竞赛已发布,不能进行编辑或删除操作"),
    EXAM_QUESTION_EXISTS(3209,"所选题目有的已存在,请仔细检查后再添加题目"),


    // 竞赛与用户之间的操作
    USER_EXAM_HAS_ENTER(3301, "用户已经报名, 无需重复报名"),

    // 文件功能
    FAILED_FILE_UPLOAD(3401,"文件上传失败"),
    FAILED_FILE_UPLOAD_TIME_LIMIT(3402,"当天文件上传次数到达上限"),

    // 切换题目
    FAILED_FIRST_QUESTION(3501,"已经是第一道题目了哦"),
    FAILED_LAST_QUESTION(3502,"已经是最后一道题目了哦"),

    // 判题逻辑
    FAILED_NOT_SUPPORT_PROGRAM(3601,"抱歉,当前系统不支持该语言"),
    // mq
    FAILED_RABBIT_PRODUCE(3701,"mq生成消息异常");


    // 状态码
    private int code;
    // 对应描述
    private String msg;
}
